package com.iwuyc.tools.commons.util.collection;

import java.util.Collection;
import java.util.Map;

/**
 * Non Thread-Safe.复合map。
 *
 * @param <K> key
 * @param <V> value
 * @author Neil
 */
public interface MultiMap<K, V, CT extends Collection<V>> extends Map<K, CT> {
    default void add(K key, V val) {
        CT valContainer = getCollection(key);
        valContainer.add(val);
    }

    CT getCollection(K key);
}
